Decompressors: check for write errors in unlzma.c
authorLasse Collin <lasse.collin@tukaani.org>
Fri, 11 Nov 2011 13:33:30 +0000 (14:33 +0100)
committerLasse Collin <lasse.collin@tukaani.org>
Fri, 11 Nov 2011 13:33:30 +0000 (14:33 +0100)
commit8e8ca04c7bbee50d35582d4f2748d644ebc47086
tree2c2dd0cc72248dde79f4eef986ca210bda3dadee
parentf4b38c6cd882bbc88c6a39a4f5d0fb81818fe107
Decompressors: check for write errors in unlzma.c

From: Lasse Collin <lasse.collin@tukaani.org>

The return value of wr->flush() is not checked in write_byte().  This
means that the decompressor won't stop even if the caller doesn't want
more data.  This can happen e.g.  with corrupt LZMA-compressed initramfs.
Returning the error quickly allows the user to see the error message
quicker.

There is a similar missing check for wr.flush() near the end of unlzma().

Signed-off-by: Lasse Collin <lasse.collin@tukaani.org>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
Committed-by: Jan Beulich <jbeulich@suse.com>
xen/common/unlzma.c